<template>
    <ListPage ref="page" :query="query" :api="getKfJxList">
        <template #search="{ page, hiddenColumns }">
            <PageSearch ref="search" :query="query" :page="page" has-box @search="() => ($refs.page as any).getData()">
                <template #auth>
                </template>
                <template #input="{ }">
                    <ElFormItem label="客服姓名" style="display: inline-block; margin-right: 10px;">
                        <ElInput v-model="query.xmOrhm" />
                    </ElFormItem>
                    <ElFormItem label="月份" style="display: inline-block; margin-right: 10px;">
                        <ElDatePicker v-model="query.yf" type="month" placeholder="选择年月" format="YYYY-MM"
                            value-format="YYYY-MM" />
                    </ElFormItem>
                    <ElButton type="primary"@click="searchData">搜索</ElButton>
                </template>
            </PageSearch>
        </template>

        <template #table="{ data, hiddenColumns }">
            <ListTable :data="data" :hidden-columns="(hiddenColumns as any)" >
            </ListTable>
        </template>
    </ListPage>
</template>

<script setup lang="ts">
import ListPage from '@/components/list-page/ListPage.vue'
import PageSearch from '@/components/list-page/PageSearch.vue'
import SearchInput from '@/components/list-page/SearchInput.vue'
import ListTable from './ListTable.vue'
import { ref, reactive } from 'vue'
import { getKfJxList } from '../api'

const query = reactive({
    keyword: '',
    xmOrhm: '',
    yf: ''
})

const page = ref()

const searchData = async () => {
    page.value.getData()
}
</script>